<?php

namespace app\model;

use think\Model;

class OrderStaff extends Model
{

	protected $connection = 'mysql';

	protected $pk = 'id';

	protected $name = 'order_staff';

	public static function getuuid($order_id)
	{
		$staff = self::where('order_id', $order_id)->order('id desc')->find();
		return $staff->uuid;
	}
	public static function is_staff($order_id)
	{
		$staff = self::where('order_id', $order_id)->order('id desc')->find();
		return $staff->id;
	}

	public static function staff($order_id)
	{
		$staff = self::where('order_id', $order_id)->order('id desc')->find();
		return Technical::getTitle($staff->uuid);
	}
	public static function addstaff($order_staff)
	{
		$res = self::create($order_staff);
		if (!empty($res)) {
			Broadcast::staff($order_staff);
			return $res;
		}
	}
}
